CREATE TABLE [dbo].[DnnProduct_PortalDesktopModules]
(
[PortalDesktopModuleID] [int] NOT NULL IDENTITY(1, 1),
[PortalID] [int] NOT NULL,
[DesktopModuleID] [int] NOT NULL,
[CreatedByUserID] [int] NULL,
[CreatedOnDate] [datetime] NULL,
[LastModifiedByUserID] [int] NULL,
[LastModifiedOnDate] [datetime] NULL
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[DnnProduct_PortalDesktopModules] ADD CONSTRAINT [PK_DnnProduct_PortalDesktopModules] PRIMARY KEY CLUSTERED  ([PortalDesktopModuleID]) WITH (FILLFACTOR=85) ON [PRIMARY]
GO
ALTER TABLE [dbo].[DnnProduct_PortalDesktopModules] ADD CONSTRAINT [IX_DnnProduct_PortalDesktopModules] UNIQUE NONCLUSTERED  ([PortalID], [DesktopModuleID]) WITH (FILLFACTOR=85) ON [PRIMARY]
GO
ALTER TABLE [dbo].[DnnProduct_PortalDesktopModules] WITH NOCHECK ADD CONSTRAINT [FK_DnnProduct_PortalDesktopModules_DnnProduct_DesktopModules] FOREIGN KEY ([DesktopModuleID]) REFERENCES [dbo].[DnnProduct_DesktopModules] ([DesktopModuleID]) ON DELETE CASCADE NOT FOR REPLICATION
GO
ALTER TABLE [dbo].[DnnProduct_PortalDesktopModules] WITH NOCHECK ADD CONSTRAINT [FK_DnnProduct_PortalDesktopModules_DnnProduct_Portals] FOREIGN KEY ([PortalID]) REFERENCES [dbo].[DnnProduct_Portals] ([PortalID]) ON DELETE CASCADE NOT FOR REPLICATION
GO
